﻿/*
------------------------------------
    Rodeo Game Engine
	Rodeo IO Module
	Copyright(c) Marcin Goryca
------------------------------------	
*/
#include "io\filease.h"

namespace rodeoio
{
const char* const FileASE::ASE_STRING = "*3DSMAX_ASCIIEXPORT 200";
const char* const FileASE::SCENE_STRING = "*SCENE";

bool FileASE::import(const char* filename)
{
    try
    {
        file_ = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);

        if(file_ == INVALID_HANDLE_VALUE)
            throw -1;
    }
    catch(...)
    {
        MessageBox(NULL, "Couldn't Load ASE file", rodeocore::HEADER, rodeocore::errIconOK);
        return false;
    }

    DWORD bytesRead = 0;
    //char tempBuffer[9] = {0};
    ReadFile(file_, buffer_, 20, &bytesRead, NULL);

    if(SCENE_STRING)
    {

    }
    
    CloseHandle(file_);
    return true;
}
}